🔄 For Each
The For Each action allows you to iterate over each item in an array or list, performing specified actions for every element. This is useful for processing collections of data one item at a time within your voiceflow.
Configuration​
- Source Array: Select or specify the array or list to loop through.
- Item Name: Define a variable name to represent the current item during each iteration.
Features​
- Iterates over each element in the specified array.
- Provides an item variable for use inside the loop.
- Supports nested actions inside the loop to act on each item.
- Allows dynamic processing of data collections.
- Easy to add or remove actions inside the loop.
Use Cases​
- Process lists of data records or user inputs.
- Perform repeated operations like sending notifications to multiple recipients.
- Aggregate or transform data item-by-item.
- Call APIs or execute logic for each element in a dataset.
Notes​
- Ensure the Source Array is a valid list or array type.
- Use meaningful item names for readability.
- You can nest other actions inside the loop to create complex voiceflow.
- For large arrays, consider performance impacts of repeated operations.
Tip: Combine the For Each action with conditional logic and custom code to create powerful, dynamic loops within your voiceflows.